Skip to content

feat(tables): improve view and filter controls - #6725

Open
j15z wants to merge 9 commits into
feat/better-table-views-uxfrom
feat/table-view-controls
Open

feat(tables): improve view and filter controls#6725
j15z wants to merge 9 commits into
feat/better-table-views-uxfrom
feat/table-view-controls

Conversation

@j15z

@j15z j15z commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

This second PR builds on #6724 and completes the table-view control changes. Users can choose which saved view is a table's default via a pin in the Views menu. The Columns menu now matches the Sort menu's typography and icon sizing and stays open across toggles. The filter builder has no Apply or Clear buttons: dropdown and row gestures apply immediately, while typed text commits on Enter or blur.

Filter commits now happen directly in completed user-event handlers, not in an after-render effect. Opening the panel, rerendering it, or refreshing column data does not write anything by itself. The save baseline still seeds from the builder's own reading of the stored filter, so a stored tree the flat builder renders differently is only normalized after the user actually edits a rule.

Autosave hardening:

  • An autosave response settling no longer remounts an open filter panel and wipes in-progress text or focus; reapplying an identical view configuration is skipped.
  • "Filter by cell value" saves the narrowed filter to the active view.
  • A stale update-view response can no longer demote the current default in the cache; a promotion must be fresh versus both its own cached row and the currently pinned row.
  • isNull and isNotNull conditions and mixed AND/OR filters round-trip through the builder without being silently dropped or flattened until the user changes them.
  • Switching a complete valueless filter to an operator or column that needs a value keeps the saved condition active until the replacement value is committed.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Five focused suites for the changed surfaces: 46 tests across resource options, the filter panel, views menu, columns menu, and view-mutation hooks.
  • Coverage includes commit-on-Enter/blur, incomplete operator transitions preserving the saved filter, passive panel/column refreshes writing nothing, OR and isNull shapes, stale promotion responses leaving the default untouched, and the disabled default pin staying inert.
  • bun run lint and bun run lint:check
  • bun run check:audits (29 repository policy audits)
  • bun run --cwd apps/sim type-check
  • bun run apps/sim/scripts/check-block-registry.ts feat/better-table-views-ux
  • Review focus: field-commit semantics, autosave reapply behavior while the panel is open, single-default cache state, and menu selection without closing the menus.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Not included. DOM interaction tests cover the changed menus and filter-commit behavior.

Post-Deploy Monitoring & Validation

  • For 24 hours, monitor table-view update errors and save-error toasts after filter, column, and default-view interactions.
  • Validate that selecting "Set as default" leaves exactly one default view and that the chosen view opens after returning to the table.
  • Validate that typed filters apply on Enter or blur, persist after leaving the panel, and that opening or passively rerendering a saved view's filter panel writes nothing.
  • Treat increased table-view update failures, duplicate defaults, or lost filter state as rollback triggers.
  • Owner: Tables feature maintainers. This child PR can be rolled back independently if the new controls regress while the autosave foundation remains healthy.

Compound Engineering

@vercel

vercel Bot commented Aug 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 19, 2026 8:35pm

Request Review

@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes filter persistence, view-default cache reconciliation, and live autosave timing—user-visible table query state—but behavior is heavily covered by tests and stale-response guards reduce cache corruption risk.

Overview
Completes table view controls on top of prior autosave work: default view is set via a pin in the Views menu (filled for current default, disabled for read-only), with focus handling so the hover menu does not close when using pins or keyboard.

Columns and Sort menus now use the same dropdown pattern—preventDefault on item select keeps menus open while toggling columns or flipping sort direction/clear.

The filter builder drops Apply/Clear: dropdowns, conjunction toggles, and row removal apply immediately; text values commit on Enter or blur through a local draft. Autosave only runs when the normalized predicate signature changes, with deferred commits when an operator change leaves a rule incomplete (e.g. valueless → equals until a value is committed). Opening the panel or refreshing columns does not write by itself.

Table shell skips replaceFilter when the incoming filter matches the current one so autosave echo does not remount the panel and steal focus; filter-by-cell and column visibility still persist explicitly. View update cache logic demotes the previous default on promotion and ignores stale isDefault responses that would strip a newer default.

Reviewed by Cursor Bugbot for commit 1fe415c. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx
Comment thread apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx Outdated
@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR completes the table-view control improvements and fixes the previously reported unsolicited OR-filter rewrite.

  • Preserves supported AND/OR boundaries while loading and editing filters.
  • Commits filter changes from completed user gestures rather than render effects.
  • Adds default-view pinning and hardens view-cache reconciliation.
  • Aligns Columns and Sort menu interaction behavior.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported unsolicited OR-filter rewrite no longer remains: opening the builder performs no write, supported OR boundaries survive conversion, and persistence occurs only after a completed user edit.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-filter/table-filter.tsx Moves commits into completed user-event handlers and preserves supported OR boundaries without writing when the panel opens.
apps/sim/lib/table/query-builder/converters.ts Extends predicate conversion to preserve valueless operators and the flat builder’s supported AND/OR grouping.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx Persists filter gestures and default-view changes while avoiding identical-filter remounts.
apps/sim/hooks/queries/tables.ts Prevents stale view-update responses from replacing or demoting a newer cached default.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/views-menu/views-menu.tsx Adds editable default-view pins while retaining menu focus and open-state behavior.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/columns-menu/columns-menu.tsx Migrates column toggles to the shared dropdown-menu presentation and keeps the menu open across selections.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Stored table-view filter] --> B[Convert predicate to builder rules]
  B --> C[Render without autosave]
  C --> D{User completes an edit?}
  D -- No --> E[Preserve stored filter]
  D -- Yes --> F[Convert complete rules to predicate]
  F --> G[Update active table filter]
  G --> H[Persist active view configuration]
Loading

Reviews (4): Last reviewed commit: "fix(tables): preserve filters during rul..." | Re-trigger Greptile

Comment thread apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx
@j15z
j15z force-pushed the feat/table-view-controls branch from e4f0403 to a262d4f Compare August 19, 2026 19:33
@j15z

j15z commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

@j15z

j15z commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

Comment thread apps/sim/hooks/queries/tables.ts
@j15z
j15z force-pushed the feat/table-view-controls branch from a262d4f to 5aa0911 Compare August 19, 2026 20:14
@j15z

j15z commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

@j15z

j15z commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 1fe415c. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants